/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.util.Arrays;
import java.util.Random;
import java.util.stream.IntStream;

/**
 * <p>Project: javaseapp - A
 * <p>Powered by webrx On 2021-09-04 08:50:12
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 16
 */
public class A {
    public static void main(String[] args) {
        Random rand = new Random();
        IntStream.generate(() -> rand.nextInt(100) + 1).limit(10).sorted().forEach(System.out::println);

        int[] num = new int[10];
        for (int i = 0; i < num.length; i++) {
            num[i] = rand.nextInt(100) + 1;
        }
        System.out.println(Arrays.toString(num));
        for (int i = 0; i < num.length - 1; i++) {
            for (int j = 0; j < num.length - 1 - i; j++) {
                if (num[j] > num[j + 1]) {
                    int t = num[j];
                    num[j] = num[j + 1];
                    num[j + 1] = t;
                }
            }
        }
        System.out.println(Arrays.toString(num));


    }
}
